@import "include/vars";
@import "include/mixins";
//
$__colorScheme: $textColorInverted;
$__textColor: $textColor;
@import "include/loading";
@import "include/generals";

%button {
  display: inline-block;
  background: $contentBackground;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  color: $textColor;
  font-size: 140%;
  font-weight: 300;
  text-decoration: none;
  margin: 10px 0;
  padding: 10px 20px;
  border-radius: 25px;
  white-space: nowrap;
}

body {
  background: $mainColor2;
  height: 100vh;
  overflow: hidden;

  > svg.loading {
    position: absolute;
    top: calc(50% - 18px);
    left: calc(50% - 18px);
  }
}

section.slide {
  position: absolute;
  width: 650px;
  top: 30vh;
  left: 0;
  right: 0;
  margin: auto;
  text-align: center;
  transition: opacity 0.3s, transform 0.3s;
  @extend %hidden;

  &.visible {
    @extend %visible;
  }

  > p.large {
    font-size: 180%;
    font-weight: $__fontWeightNormal;
    color: $textColorInverted;
    margin: 0 0 40px 0;
  }

  > p.desc {
    position: relative;
    background: $contentBackground;
    color: $textColor;
    width: 400px;
    font-size: 90%;
    line-height: 160%;
    margin: 15px auto 0;
    padding: 7px 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transform: translate3d(0, -7px, 0);
    transition: opacity 0.3s, transform 0.3s;
    @extend %hidden;

    &::before {
      content: "";
      position: absolute;
      top: -14px;
      left: 0;
      right: 0;
      margin: auto;
      width: 0;
      border: 7px solid transparent;
      border-bottom-color: $contentBackground;
    }
  }

  > a.info {
    @extend %button;
    @include mask('icon-info', $textColor, 26px);
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    margin: 70px auto 0;
    border-radius: 50%;

    &:hover + p.desc {
      @extend %visible;
      transform: translate3d(0, 0, 0);
    }
  }

  &[data-name='intro'] {

    &::before {
      content: "";
      position: absolute;
      top: -100px;
      left: 0;
      right: 0;
      margin: auto;
      width: 64px;
      height: 64px;
      background: img('icon/icon.png') no-repeat center / 100%;
    }

    > a.nextSlide {
      @extend %button;
    }

    > a.skip {
      color: $textColorInverted;
      font-size: 90%;
      opacity: 0.5;
    }
  }

  &[data-name='position'], &[data-name='openAction'], &[data-name='surface'] {

    > div {
      display: flex;
      flex-wrap: wrap;
      flex-direction: row;
      justify-content: center;
      align-items: center;

      > a {
        @extend %button;
        margin-left: 12px;
        margin-right: 12px;
      }
    }
  }

  &[data-name='surface'] {

    a[data-value="dark"] {
      background: $darkContentBackground;
      color: $textColorInverted;
      box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    }

    p.wrap {
      width: 100%;
      margin: 20px 0 0 0;

      a[data-value="auto"] {
        @extend %button;
        position: relative;
        overflow: hidden;
        font-size: 100%;
        padding: 8px 14px;

        &::before {
          content: "";
          position: absolute;
          top: 0;
          left: 50%;
          width: 100%;
          height: 100%;
          background: $darkContentBackground;
          transform: skewX(-20deg);
        }

        > span {
          color: $textColorInverted;
          mix-blend-mode: difference;
          filter: drop-shadow(2px 2px 2px rgba(255, 255, 255, 0.2));
        }
      }
    }
  }

  &[data-name='handson'] {

    > p.large {
      margin-bottom: 70px;
    }

    > p:not(.large) {
      color: $textColorInverted;
      font-size: 120%;
      opacity: 0.7;
      padding: 7px 0;
    }
  }

  &[data-name='finished'] {

    a.settings, a.appearance {
      @include mask(null, $textColorInverted, 72px);
      position: relative;
      display: inline-block;
      width: 150px;
      padding: 85px 15px 10px 15px;
      margin: 0 10px;
      color: $textColorInverted;
      vertical-align: top;
      border-radius: 10px;
      transition: background 0.5s;

      &::before {
        -webkit-mask-position-y: 7px;
      }

      &:hover {
        background: rgba(255, 255, 255, 0.1);
      }
    }

    a.settings::before {
      @include maskImage('icon-settings');
    }

    a.appearance::before {
      @include maskImage('settings/icon-appearance');
    }

    p.info {
      @include mask('icon-info', $textColorInverted, 36px);
      position: relative;
      padding: 20px 30px 24px 65px;
      margin: 0 0 40px 0;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.1);
      text-align: left;

      > span {
        display: block;
        font-size: 120%;
        line-height: 160%;
        color: $textColorInverted;
      }

      &::before {
        -webkit-mask-position-x: 15px;
        -webkit-mask-position-y: 22px;
      }

      > a {
        position: relative;
        display: inline-block;
        background: $textColorInverted;
        color: $textColor;
        cursor: pointer;
        padding: 4px 12px;
        margin-top: 10px;
        border-radius: 25px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
      }
    }
  }
}

// Sidebar placeholder
div#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 100%;
  background: $contentBackground;
  padding: 10px 30px 0 80px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  transform: translate3d(-350px, 0, 0);
  transition: transform 0.5s, background-color 0.3s;
  z-index: 3;

  &[data-pos='right'] {
    transform: translate3d(350px, 0, 0);
    left: unset;
    right: 0;
  }

  &.visible {
    transform: translate3d(0, 0, 0);
  }

  > p {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.06);
    transition: background-color 0.3s;
    margin: 50px 0;

    &::before {
      content: "";
      position: absolute;
      top: -10px;
      left: -50px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: inherit;
    }
  }
}

body {

  &[data-surface='dark'] {

    div#sidebar {
      background: $darkContentBackground;

      > p {
        background: rgba(255, 255, 255, 0.1);
      }
    }
  }

  &[data-openType] {
    @include mask(null, $textColorInverted, 48px);

    &::before {
      content: "";
      position: absolute;
      width: 48px;
      height: 48px;
      transition: opacity 0.2s;
    }
  }

  &[data-openType='icon']::before {
    @include maskImage('icon-arrow-sketch');
    top: 50px;
    left: auto;
    right: 80px;
  }

  &[data-openType='mouse']::before {
    @include maskImage('onboarding/icon-cursor');
    top: 0;
    bottom: 0;
    margin: auto;
  }

  &[data-openType='mouse'][data-pos='right']::before {
    left: auto;
    right: 0;
    transform: rotateY(180deg);
  }

  &.hideOpenType::before {
    opacity: 0;
  }
}

@media (max-width: 1500px) {
  body {

    &[data-pos='left'] {

      section.slide:not([data-name='position']):not([data-name='handson']) {
        right: 40px;
        left: auto;
      }
    }

    &[data-pos='right'] {

      section.slide:not([data-name='position']):not([data-name='handson']) {
        left: 40px;
      }
    }
  }
}

@import "rtl/onboarding";